<?php
/**
* @file media_db_aux.php
* @version 0.0.1
* @package Media_db
* @copyright Copyright (C) 2006 Nikolai Plath. All rights reserved
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*
* Diverse Funktionen
*/
defined( '_VALID_MOS' ) or die ( 'Go away..');// wer weiss......

function updateme () {
	global $database;
	global $medias;
	
	$database->setQuery( "SELECT * FROM #__media_db" );
	$medias = $database->loadObjectList();
}

function mdb_format_cut ($text, $anzahl) {
   if (strlen($text) > $anzahl) {
      preg_match ("/(.{0,$anzahl}\b)/s", $text, $kurz);
		return $kurz[0]."...".mosToolTip($text ,'', '', 'tooltip.png');
   }
   else return $text;
}

function mdb_out_mdbaktual () {
  echo '<div class="media_db_advert2">Datenbank aktualisiert</div>';
}

function mdb_reorderDate($inputDate) {

   $year = substr($inputDate, 0, 4);
	$year = intval($year);
   $month = substr($inputDate, 5, 2);
	$month = intval($month);
   $day = substr($inputDate, 8, 2);
	$day = intval($day);

   $outputDate = $day.".".$month.".".$year;
   return $outputDate;
}


/*
	$newtext = '';
	$newtext = substr($text, 0, $anzahl);
	if (strlen($text) > $anzahl) {
	
	$text = nl2br($text);
	$text = preg_replace("/\r|\n/s", "", $text);
	
		$newtext .= '...'.mosToolTip($text ,'', '', 'arrow.png');
	}
	return $newtext;
}
*/
?>
